<?php

use yii\helpers\Url;

/* @var $this yii\web\View */

$this->title = '系统概览';
?>
<div class="site-index">

    <div class="body-content">
        <div class="row">
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-aqua" style="font-size:28px;">MYSQL</span>

            <div class="info-box-content">
              <span class="info-box-text"><?php if($mysql == true){?><span style="font-size:18px;color:green;">[√] 已开启</span><?php }else{?><span style="font-size:18px;color:red;">[×] 未开启</span><?php }?></span>
              <span class="info-box-number"><small style="color:gray;font-weight: normal;">未开启则无法使用本系统</small></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-red" style="font-size:28px;">GD</span>

            <div class="info-box-content">
              <span class="info-box-text"><?php if($gd == true){?><span style="font-size:18px;color:green;">[√] 已开启</span><?php }else{?><span style="font-size:18px;color:red;">[×] 未开启</span><?php }?></span>
              <span class="info-box-number"><small style="color:gray;font-weight: normal;">未开启将导致图片渲染功能无法使用</small></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->

        <!-- fix for small devices only -->
        <div class="clearfix visible-sm-block"></div>

        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-green" style="font-size: 28px;">CURL</span>

            <div class="info-box-content">
              <span class="info-box-text"><?php if($curl == true){?><span style="font-size:18px;color:green;">[√] 已开启</span><?php }else{?><span style="font-size:18px;color:red;">[×] 未开启</span><?php }?></span>
              <span class="info-box-number"><small style="color:gray;font-weight: normal;">未开启将导致远程文件操作无法应用</small></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
        <div class="col-md-3 col-sm-6 col-xs-12">
          <div class="info-box">
            <span class="info-box-icon bg-yellow" style="font-size: 28px;">INTL</span>

            <div class="info-box-content">
              <span class="info-box-text"><?php if($intl == true){?><span style="font-size:18px;color:green;">[√] 已开启</span><?php }else{?><span style="font-size:18px;color:red;">[×] 未开启</span><?php }?></span>
              <span class="info-box-number"><small style="color:gray;font-weight: normal;">未开启将导致国际化语言无法使用</small></span>
            </div>
            <!-- /.info-box-content -->
          </div>
          <!-- /.info-box -->
        </div>
        <!-- /.col -->
      </div>
        <div class="box">
            <div class="box-header">
              <h3 class="box-title">运行环境、更好的了解服务器情况</h3>
            </div>
            <!-- /.box-header -->
            <div class="box-body no-padding">
              <table class="table table-striped table-hover">
                <tbody><tr>
                  <th style="width: 10px">#</th>
                  <th>System</th>
                  <th>Detail</th>
                </tr>
                <tr>
                  <td>1.</td>
                  <td>服务器名称</td>
                  <td>操作系统 <?php echo PHP_OS;?>&nbsp;名称 <?php echo $_SERVER['HTTP_HOST']; ?>(IP:<?php echo $serverIp; ?>) 端口 <?php echo $_SERVER['SERVER_PORT']; ?></td>
                </tr>
                <tr>
                  <td>2.</td>
                  <td>站点物理路径</td>
                  <td><?php echo $_SERVER['DOCUMENT_ROOT']; ?></td>
                </tr>
                <tr>
                  <td>3.</td>
                  <td>服务器环境</td>
                  <td><?php echo $_SERVER['SERVER_SOFTWARE'];?></td>
                </tr>
                <tr>
                  <td>4.</td>
                  <td>PHP运行方式</td>
                  <td><?php echo php_sapi_name();?></td>
                </tr>
                <tr>
                  <td>5.</td>
                  <td>服务器操作系统</td>
                  <td><?php if(PATH_SEPARATOR==':'){echo 'Linux';}else{echo 'Windows';} ?></td>
                </tr>
                <tr>
                  <td>6.</td>
                  <td>MYSQL版本</td>
                  <td>Mysql <?= $mysqlVersion ?></td>
                </tr>
                <tr>
                  <td>7.</td>
                  <td>上传文件最大限制</td>
                  <td><?php echo ini_get('upload_max_filesize');?><span style="color:gray;"> (如需修改可查看 <code><a href="http://wangking717.iteye.com/blog/1947080" target="_blank">参考文档</a></code>，建议支持10M的文件上传)</span></td>
                </tr>
                <tr>
                  <td>8.</td>
                  <td>剩余空间</td>
                  <td><?php echo round((@disk_free_space(".") / (1024 * 1024)), 2) . 'M';?></td>
                </tr>
                <tr>
                  <td>9.</td>
                  <td>回收站提示</td>
                  <td>共有<?= $garbageFileSize ?>垃圾文件&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?= Url::to(['/site/clear-temp'])?>" class="btn btn-default btn-sm" role="button">立即清除</a></td>
                </tr>
              </tbody></table>
            </div>
            <!-- /.box-body -->
          </div>

    </div>
</div>
